<?php

$sql =<<<EOF
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_account` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `pwd` varchar(50) NOT NULL,
  `mobile` varchar(20) NOT NULL,
  `email` varchar(20) NOT NULL,
  `from_user` varchar(100) NOT NULL DEFAULT '',
  `storeid` varchar(1000) NOT NULL,
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  `pay_account` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_ad` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `uniacid` int(10) unsigned NOT NULL,
  `title` varchar(100) NOT NULL DEFAULT '',
  `url` varchar(200) NOT NULL DEFAULT '',
  `thumb` varchar(500) NOT NULL DEFAULT '',
  `position` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1:首页,2:商家页',
  `starttime` int(10) NOT NULL DEFAULT '0' COMMENT '开始时间',
  `endtime` int(10) NOT NULL DEFAULT '0' COMMENT '结束时间',
  `displayorder` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否显示',
  `dateline` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `realname` varchar(20) NOT NULL,
  `mobile` varchar(11) NOT NULL,
  `address` varchar(300) NOT NULL,
  `dateline` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_area` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `name` varchar(50) NOT NULL COMMENT '区域名称',
  `parentid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID,0为第一级',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_blacklist` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `from_user` varchar(100) DEFAULT '' COMMENT '用户ID',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `dateline` int(10) DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`),
  KEY `idx_openid` (`from_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_businesslog` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `uid` int(10) unsigned NOT NULL,
  `price` varchar(20) DEFAULT '' COMMENT '申请金额',
  `haveprice` varchar(20) DEFAULT '' COMMENT '已申请总金额',
  `totalprice` varchar(20) DEFAULT '' COMMENT '当时可总金额',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `handletime` int(10) DEFAULT '0' COMMENT '处理时间',
  `dateline` int(10) DEFAULT '0',
  `dining_mode` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型1店内2外卖3预定4快餐',
  `charges` varchar(20) DEFAULT '' COMMENT '手续费',
  `successprice` varchar(20) DEFAULT '' COMMENT '到帐金额',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_cart` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `goodsid` int(11) NOT NULL,
  `goodstype` tinyint(1) NOT NULL DEFAULT '1',
  `price` varchar(10) NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `total` int(10) unsigned NOT NULL,
  `packvalue` varchar(10) NOT NULL DEFAULT '0' COMMENT '打包费',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `name` varchar(50) NOT NULL COMMENT '分类名称',
  `parentid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID,0为第一级',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否开启',
  `is_meal` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否店内点餐',
  `is_delivery` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否外卖订餐',
  `is_snack` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否支持快餐',
  `is_reservation` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否支持预定',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_collection` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `from_user` varchar(50) NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `dateline` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_commission` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店编号',
  `orderid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单编号',
  `agentid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级编号',
  `ordersn` varchar(100) DEFAULT '',
  `from_user` varchar(100) DEFAULT '' COMMENT '购买者openid',
  `price` decimal(10,2) DEFAULT '0.00',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
  `dateline` int(10) DEFAULT '0',
  `level` tinyint(1) NOT NULL DEFAULT '1' COMMENT '级别',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_coupon` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) NOT NULL DEFAULT '0' COMMENT '公众号id',
  `storeid` int(10) NOT NULL DEFAULT '0' COMMENT '门店id',
  `levelid` tinyint(1) NOT NULL DEFAULT '0' COMMENT '所属人群',
  `title` varchar(50) NOT NULL COMMENT '优惠券名称',
  `thumb` varchar(500) NOT NULL DEFAULT '' COMMENT '图片',
  `attr_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '属性 1=普通券 2=营销券',
  `ruletype` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=不限 2=首单',
  `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '优惠券类型 1=优惠券 2=代金券 3=礼品券 4=积分兑换',
  `gmoney` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `dmoney` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '抵用金额',
  `content` text NOT NULL COMMENT '详细内容',
  `totalcount` int(10) NOT NULL DEFAULT '0' COMMENT '发放总数',
  `usercount` int(10) NOT NULL DEFAULT '0' COMMENT '每人领取张数',
  `ticket_ty` tinyint(1) NOT NULL DEFAULT '0' COMMENT '积分兑换优惠券类型 1=优惠券2=代金券3=礼品券',
  `ticket_id` int(10) NOT NULL DEFAULT '0' COMMENT '优惠券id',
  `needscore` int(10) NOT NULL DEFAULT '0' COMMENT '兑换需要积分',
  `starttime` int(10) NOT NULL DEFAULT '0' COMMENT '开始时间',
  `endtime` int(10) NOT NULL DEFAULT '0' COMMENT '结束时间',
  `displayorder` tinyint(4) NOT NULL DEFAULT '0',
  `dateline` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_email_setting` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `email_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启邮箱提醒',
  `email_host` varchar(50) DEFAULT '' COMMENT '邮箱服务器',
  `email_send` varchar(100) DEFAULT '' COMMENT '商户发送邮件邮箱',
  `email_pwd` varchar(20) DEFAULT '' COMMENT '邮箱密码',
  `email_user` varchar(100) DEFAULT '' COMMENT '发信人名称',
  `email` varchar(100) DEFAULT '' COMMENT '商户接收邮件邮箱',
  `email_business_tpl` varchar(200) DEFAULT '' COMMENT '商户接收内容模板',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_fans` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `weid` int(11) DEFAULT '0',
  `from_user` varchar(50) DEFAULT '' COMMENT '用户ID',
  `nickname` varchar(50) DEFAULT '',
  `headimgurl` varchar(500) DEFAULT '',
  `username` varchar(50) DEFAULT '',
  `mobile` varchar(50) DEFAULT '',
  `address` varchar(200) DEFAULT '',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
  `lat` decimal(18,10) NOT NULL DEFAULT '0.0000000000' COMMENT '经度',
  `lng` decimal(18,10) NOT NULL DEFAULT '0.0000000000' COMMENT '纬度',
  `status` tinyint(1) DEFAULT '1',
  `dateline` int(10) DEFAULT '0',
  `storeid` int(11) DEFAULT '0',
  `totalcount` int(10) DEFAULT '0' COMMENT '交易次数',
  `totalprice` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '交易总金额',
  `avgprice` decimal(18,2) NOT NULL DEFAULT '0.00' COMMENT '平均金额',
  `uid` int(11) DEFAULT '0',
  `paytime` int(10) DEFAULT '0',
  `lasttime` int(10) DEFAULT '0',
  `agentid2` int(11) DEFAULT '0',
  `agentid3` int(11) DEFAULT '0',
  `noticetime` int(10) DEFAULT '0',
  `agentid` int(11) DEFAULT '0',
  `country` varchar(50) DEFAULT '',
  `province` varchar(50) DEFAULT '',
  `city` varchar(50) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `indx_rid` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_feedback` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店编号',
  `orderid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单编号',
  `from_user` varchar(100) DEFAULT '',
  `star` tinyint(1) NOT NULL DEFAULT '5' COMMENT '等级',
  `content` varchar(500) DEFAULT '' COMMENT '回复内容',
  `displayorder` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `storeid` int(10) unsigned NOT NULL,
  `weid` int(10) unsigned NOT NULL,
  `pcate` int(10) unsigned NOT NULL DEFAULT '0',
  `ccate` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `recommend` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否推荐',
  `displayorder` int(10) unsigned NOT NULL DEFAULT '0',
  `title` varchar(100) NOT NULL DEFAULT '',
  `thumb` varchar(500) NOT NULL DEFAULT '',
  `unitname` varchar(5) NOT NULL DEFAULT '份',
  `description` varchar(1000) NOT NULL DEFAULT '',
  `taste` varchar(1000) NOT NULL DEFAULT '' COMMENT '口味',
  `isspecial` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `marketprice` varchar(10) NOT NULL DEFAULT '',
  `productprice` varchar(10) NOT NULL DEFAULT '',
  `credit` int(10) NOT NULL DEFAULT '0',
  `subcount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '被点次数',
  `dateline` int(10) unsigned NOT NULL,
  `lasttime` int(10) NOT NULL DEFAULT '0',
  `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `counts` int(10) NOT NULL DEFAULT '-1',
  `sales` int(10) unsigned NOT NULL DEFAULT '0',
  `today_counts` int(10) NOT NULL DEFAULT '0',
  `labelid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '打印标签',
  `packvalue` varchar(10) NOT NULL DEFAULT '0' COMMENT '打包费',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_intelligent` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `name` int(10) NOT NULL DEFAULT '0' COMMENT '适用人数',
  `content` varchar(1000) NOT NULL DEFAULT '' COMMENT '商品',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否开启',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_mealtime` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `begintime` varchar(20) DEFAULT '09:00' COMMENT '开始时间',
  `endtime` varchar(20) DEFAULT '18:00' COMMENT '结束时间',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否开启',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_nave` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `type` int(10) NOT NULL DEFAULT '-1' COMMENT '链接类型 -1:自定义 1:首页2:门店3:菜单列表4:我的菜单',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '导航名称',
  `link` varchar(200) NOT NULL DEFAULT '' COMMENT '导航链接',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否开启',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL COMMENT '公众号id',
  `storeid` int(10) unsigned NOT NULL COMMENT '门店id',
  `from_user` varchar(50) NOT NULL,
  `ordersn` varchar(30) NOT NULL COMMENT '订单号',
  `totalnum` tinyint(4) DEFAULT NULL COMMENT '总数量',
  `totalprice` varchar(10) NOT NULL COMMENT '总金额',
  `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '-1取消状态，0普通状态，1为确认付款方式，2为成功',
  `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '1余额，2微信支付，3到付',
  `transid` varchar(30) NOT NULL DEFAULT '0' COMMENT '微信支付单号',
  `username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户名',
  `address` varchar(250) NOT NULL DEFAULT '' COMMENT '地址',
  `tel` varchar(50) NOT NULL DEFAULT '' COMMENT '联系电话',
  `reply` varchar(1000) NOT NULL DEFAULT '' COMMENT '回复',
  `meal_time` varchar(50) NOT NULL DEFAULT '' COMMENT '就餐时间',
  `counts` tinyint(4) DEFAULT '0' COMMENT '预订人数',
  `seat_type` tinyint(1) DEFAULT '0' COMMENT '位置类型1大厅2包间',
  `carports` tinyint(3) DEFAULT '0' COMMENT '车位',
  `goodsprice` decimal(10,2) DEFAULT '0.00',
  `dispatchprice` decimal(10,2) DEFAULT '0.00',
  `dining_mode` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '用餐类型 1:到店 2:外卖',
  `remark` varchar(1000) NOT NULL DEFAULT '' COMMENT '备注',
  `tables` varchar(10) NOT NULL DEFAULT '' COMMENT '桌号',
  `print_sta` tinyint(1) DEFAULT '-1' COMMENT '打印状态',
  `sign` tinyint(1) NOT NULL DEFAULT '0' COMMENT '-1拒绝，0未处理，1已处理',
  `isfinish` tinyint(1) NOT NULL DEFAULT '0',
  `isemail` tinyint(1) NOT NULL DEFAULT '0',
  `issms` tinyint(1) NOT NULL DEFAULT '0',
  `istpl` tinyint(1) NOT NULL DEFAULT '0',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `credit` varchar(10) NOT NULL DEFAULT '0' COMMENT '赠送积分',
  `paydetail` varchar(1000) NOT NULL DEFAULT '' COMMENT '消费详细信息',
  `ispay` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0,1,2',
  `tablezonesid` varchar(10) NOT NULL DEFAULT '' COMMENT '桌台类别',
  `isfeedback` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否留言',
  `couponid` int(10) unsigned NOT NULL DEFAULT '0',
  `packvalue` varchar(10) NOT NULL DEFAULT '0' COMMENT '打包费',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=40 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_order_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `orderid` int(10) unsigned NOT NULL,
  `goodsid` int(10) unsigned NOT NULL,
  `price` varchar(10) NOT NULL,
  `total` int(10) unsigned NOT NULL DEFAULT '1',
  `dateline` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=78 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_print_label` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店id',
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `title` varchar(50) NOT NULL COMMENT '标签名称',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否开启',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_print_order` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `orderid` int(10) unsigned NOT NULL,
  `print_usr` varchar(50) DEFAULT '',
  `print_status` tinyint(1) DEFAULT '-1',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=61 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_print_setting` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `title` varchar(200) DEFAULT '',
  `print_status` tinyint(1) NOT NULL,
  `type` varchar(50) DEFAULT 'hongxin',
  `member_code` varchar(100) DEFAULT '' COMMENT '商户代码',
  `feyin_key` varchar(100) DEFAULT '' COMMENT 'api密钥',
  `print_type` tinyint(1) NOT NULL,
  `print_usr` varchar(50) DEFAULT '',
  `print_nums` tinyint(3) DEFAULT '1',
  `print_top` varchar(40) DEFAULT '',
  `print_bottom` varchar(40) DEFAULT '',
  `qrcode_status` tinyint(1) NOT NULL DEFAULT '0',
  `qrcode_url` varchar(200) DEFAULT '',
  `dateline` int(10) DEFAULT '0',
  `is_print_all` tinyint(1) NOT NULL DEFAULT '1',
  `print_goodstype` varchar(500) DEFAULT '',
  `yilian_type` tinyint(1) DEFAULT '1',
  `api_key` varchar(100) DEFAULT '' COMMENT 'api密钥',
  `print_label` varchar(500) DEFAULT '0',
  `is_meal` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否店内点餐',
  `is_delivery` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否外卖订餐',
  `is_snack` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否支持快餐',
  `is_reservation` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否支持预定',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_queue_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `queueid` int(10) unsigned NOT NULL DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `from_user` varchar(200) NOT NULL DEFAULT '',
  `num` varchar(100) NOT NULL DEFAULT '',
  `mobile` varchar(30) NOT NULL DEFAULT '',
  `usercount` int(10) unsigned NOT NULL DEFAULT '0',
  `isnotify` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
  `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=18 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_queue_setting` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `title` varchar(200) NOT NULL DEFAULT '',
  `limit_num` int(10) unsigned NOT NULL DEFAULT '0',
  `prefix` varchar(50) NOT NULL,
  `starttime` varchar(50) NOT NULL DEFAULT '00:00' COMMENT '开始时间',
  `endtime` varchar(50) NOT NULL DEFAULT '23:59' COMMENT '结束时间',
  `notify_number` int(10) NOT NULL DEFAULT '0' COMMENT '通知人数',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_reply` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `rid` int(10) unsigned NOT NULL,
  `weid` int(10) unsigned NOT NULL,
  `title` varchar(255) NOT NULL DEFAULT '',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '入口类型',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '入口门店',
  `description` varchar(1000) NOT NULL DEFAULT '',
  `picture` varchar(255) NOT NULL DEFAULT '',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '添加日期',
  PRIMARY KEY (`id`),
  KEY `idx_rid` (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_reservation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `tablezonesid` int(10) unsigned NOT NULL DEFAULT '0',
  `time` varchar(200) NOT NULL DEFAULT '',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_savewine_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店编号',
  `from_user` varchar(100) DEFAULT '',
  `savenumber` varchar(100) NOT NULL DEFAULT '' COMMENT '存酒卡号',
  `title` varchar(200) DEFAULT NULL COMMENT '物品名称',
  `username` varchar(100) DEFAULT NULL COMMENT '用户姓名',
  `tel` varchar(30) DEFAULT NULL COMMENT '联系电话',
  `remark` text NOT NULL COMMENT '备注',
  `displayorder` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  `takeouttime` int(10) unsigned NOT NULL DEFAULT '0',
  `savetime` int(10) unsigned NOT NULL DEFAULT '0',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_service_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店编号',
  `from_user` varchar(100) DEFAULT '',
  `content` varchar(1000) DEFAULT NULL COMMENT '内容',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_setting` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `title` varchar(50) DEFAULT '' COMMENT '网站名称',
  `thumb` varchar(200) DEFAULT '' COMMENT '背景图',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `entrance_type` tinyint(1) unsigned NOT NULL COMMENT '入口类型1:首页2门店列表3商品列表4我的菜单',
  `entrance_storeid` tinyint(1) unsigned NOT NULL COMMENT '入口门店id',
  `order_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订餐开启',
  `dining_mode` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '用餐类型 1:到店 2:外卖',
  `istplnotice` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否模版通知',
  `tplneworder` varchar(200) DEFAULT '' COMMENT '模板id',
  `searchword` varchar(1000) DEFAULT '' COMMENT '搜索关键字',
  `tpluser` text COMMENT '通知用户',
  `dateline` int(10) DEFAULT '0',
  `mode` tinyint(1) NOT NULL DEFAULT '0' COMMENT '模式',
  `tplnewqueue` varchar(200) DEFAULT '' COMMENT '模板id',
  `is_notice` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '开启提醒',
  `sms_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启短信提醒',
  `sms_username` varchar(20) DEFAULT '' COMMENT '平台帐号',
  `sms_pwd` varchar(20) DEFAULT '' COMMENT '平台密码',
  `sms_mobile` varchar(20) DEFAULT '' COMMENT '商户接收短信手机',
  `email_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启邮箱提醒',
  `email_host` varchar(50) DEFAULT '' COMMENT '邮箱服务器',
  `email_send` varchar(100) DEFAULT '' COMMENT '商户发送邮件邮箱',
  `email_pwd` varchar(20) DEFAULT '' COMMENT '邮箱密码',
  `email_user` varchar(100) DEFAULT '' COMMENT '发信人名称',
  `email` varchar(100) DEFAULT '' COMMENT '商户接收邮件邮箱',
  `tpltype` tinyint(1) NOT NULL DEFAULT '1' COMMENT '模版行业类型',
  `tploperator` varchar(200) DEFAULT '' COMMENT '模板id',
  `commission_level` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '分销级别',
  `share_title` varchar(200) DEFAULT '',
  `share_desc` varchar(300) DEFAULT '',
  `share_image` varchar(500) DEFAULT '',
  `commission2_rate_max` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '佣金费率',
  `commission2_value_max` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提现手续费最低金额',
  `commission3_rate_max` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '佣金费率',
  `commission3_value_max` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提现手续费最低金额',
  `is_commission` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启分销',
  `commission1_rate_max` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '佣金费率',
  `commission1_value_max` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提现手续费最低金额',
  `commission_settlement` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '佣金结算方式',
  `getcash_price` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最低提现金额',
  `fee_rate` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现费率',
  `fee_min` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提现手续费最低金额',
  `fee_max` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提现手续费最高金额',
  `follow_url` varchar(500) DEFAULT '',
  `isneedfollow` tinyint(1) DEFAULT '0',
  `wechat` tinyint(1) NOT NULL DEFAULT '1',
  `alipay` tinyint(1) NOT NULL DEFAULT '1',
  `credit` tinyint(1) NOT NULL DEFAULT '1',
  `delivery` tinyint(1) NOT NULL DEFAULT '1',
  `is_speaker` tinyint(1) NOT NULL DEFAULT '1',
  `link_card` varchar(500) DEFAULT '',
  `link_sign` varchar(500) DEFAULT '',
  `link_sign_name` varchar(100) DEFAULT '',
  `link_card_name` varchar(100) DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_sms_checkcode` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `from_user` varchar(100) DEFAULT '' COMMENT '用户ID',
  `mobile` varchar(30) DEFAULT '' COMMENT '手机',
  `checkcode` varchar(100) DEFAULT '' COMMENT '验证码',
  `status` tinyint(1) unsigned DEFAULT '0' COMMENT '状态 0未使用1已使用',
  `dateline` int(10) DEFAULT '0' COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_sms_setting` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `sms_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启短信提醒',
  `sms_verify_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启短信验证提醒',
  `sms_username` varchar(20) DEFAULT '' COMMENT '平台帐号',
  `sms_pwd` varchar(20) DEFAULT '' COMMENT '平台密码',
  `sms_mobile` varchar(20) DEFAULT '' COMMENT '商户接收短信手机',
  `sms_verify_tpl` varchar(120) DEFAULT '' COMMENT '验证短信模板',
  `sms_business_tpl` varchar(120) DEFAULT '' COMMENT '商户短信模板',
  `sms_user_tpl` varchar(120) DEFAULT '' COMMENT '用户短信模板',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_sncode` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `couponid` int(10) NOT NULL DEFAULT '0' COMMENT '优惠券id',
  `storeid` int(10) NOT NULL DEFAULT '0' COMMENT '门店id',
  `weid` int(10) NOT NULL DEFAULT '0' COMMENT '公众号id',
  `from_user` varchar(100) NOT NULL COMMENT 'openid',
  `title` varchar(40) NOT NULL,
  `sncode` varchar(100) NOT NULL COMMENT 'sn码',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1优惠券2代金券3礼品券',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '消费金额',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
  `isshow` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否显示 用户删除时更新',
  `winningtime` int(10) NOT NULL DEFAULT '0' COMMENT '生成时间',
  `usetime` int(10) NOT NULL DEFAULT '0' COMMENT '使用时间',
  `dateline` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_store_setting` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL,
  `storeid` int(10) unsigned NOT NULL,
  `order_enable` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订餐开启',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_stores` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) NOT NULL DEFAULT '0' COMMENT '公众号id',
  `areaid` int(10) NOT NULL DEFAULT '0' COMMENT '区域id',
  `typeid` int(10) NOT NULL DEFAULT '0' COMMENT '商家类型',
  `title` varchar(50) NOT NULL DEFAULT '' COMMENT '名称',
  `logo` varchar(500) NOT NULL DEFAULT '' COMMENT '商家logo',
  `info` varchar(1000) NOT NULL DEFAULT '' COMMENT '简短描述',
  `content` text NOT NULL COMMENT '简介',
  `announce` varchar(1000) NOT NULL DEFAULT '' COMMENT '通知',
  `tel` varchar(20) NOT NULL DEFAULT '' COMMENT '联系电话',
  `location_p` varchar(100) NOT NULL DEFAULT '' COMMENT '省',
  `location_c` varchar(100) NOT NULL DEFAULT '' COMMENT '市',
  `location_a` varchar(100) NOT NULL DEFAULT '' COMMENT '区',
  `address` varchar(200) NOT NULL COMMENT '地址',
  `place` varchar(200) NOT NULL DEFAULT '',
  `lat` decimal(18,10) NOT NULL DEFAULT '0.0000000000' COMMENT '经度',
  `lng` decimal(18,10) NOT NULL DEFAULT '0.0000000000' COMMENT '纬度',
  `password` varchar(20) NOT NULL DEFAULT '' COMMENT '登录密码',
  `hours` varchar(200) NOT NULL DEFAULT '' COMMENT '营业时间',
  `recharging_password` varchar(20) NOT NULL DEFAULT '' COMMENT '充值密码',
  `thumb_url` varchar(1000) DEFAULT NULL,
  `enable_wifi` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有wifi',
  `enable_card` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否能刷卡',
  `enable_room` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有包厢',
  `enable_park` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有停车',
  `is_hot` tinyint(1) NOT NULL DEFAULT '0' COMMENT '搜索页显示',
  `is_rest` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否休息中',
  `is_show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否在手机端显示',
  `is_meal` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否店内点餐',
  `is_delivery` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否外卖订餐',
  `is_sms` tinyint(1) NOT NULL DEFAULT '0',
  `is_hour` tinyint(1) NOT NULL DEFAULT '0',
  `begintime` varchar(20) DEFAULT '09:00' COMMENT '开始时间',
  `endtime` varchar(20) DEFAULT '18:00' COMMENT '结束时间',
  `sendingprice` varchar(10) NOT NULL DEFAULT '' COMMENT '起送价格',
  `dispatchprice` decimal(10,2) DEFAULT '0.00',
  `freeprice` decimal(10,2) DEFAULT '0.00',
  `consume` varchar(20) NOT NULL COMMENT '人均消费',
  `level` tinyint(1) NOT NULL DEFAULT '1' COMMENT '级别',
  `displayorder` tinyint(3) NOT NULL DEFAULT '0',
  `updatetime` int(10) NOT NULL DEFAULT '0',
  `dateline` int(10) NOT NULL DEFAULT '0',
  `from_user` varchar(200) NOT NULL DEFAULT '',
  `delivery_within_days` int(10) NOT NULL DEFAULT '0',
  `delivery_radius` decimal(18,1) NOT NULL DEFAULT '0.0' COMMENT '半径',
  `not_in_delivery_radius` tinyint(1) NOT NULL DEFAULT '1' COMMENT '在配送半径之外是否允许下单',
  `btn_reservation` varchar(100) NOT NULL DEFAULT '预定' COMMENT '预定按钮',
  `btn_eat` varchar(100) NOT NULL DEFAULT '点菜' COMMENT '点菜按钮',
  `btn_delivery` varchar(100) NOT NULL DEFAULT '外卖' COMMENT '外卖按钮',
  `btn_snack` varchar(100) NOT NULL DEFAULT '快餐' COMMENT '快餐按钮',
  `btn_queue` varchar(100) NOT NULL DEFAULT '排队' COMMENT '排队按钮',
  `btn_intelligent` varchar(100) NOT NULL DEFAULT '套餐' COMMENT '套餐按钮',
  `is_snack` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持快餐',
  `is_reservation` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持预定',
  `is_queue` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持排队',
  `is_intelligent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持套餐',
  `coupon_title1` varchar(100) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `coupon_title2` varchar(100) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `coupon_title3` varchar(100) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `coupon_link1` varchar(200) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `coupon_link2` varchar(200) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `coupon_link3` varchar(200) NOT NULL DEFAULT '' COMMENT '优惠名称',
  `qq` varchar(20) NOT NULL DEFAULT '',
  `weixin` varchar(20) NOT NULL DEFAULT '',
  `default_jump` tinyint(2) NOT NULL DEFAULT '1' COMMENT '默认类型',
  `is_savewine` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持寄存',
  `notice_space_time` int(10) DEFAULT '300',
  `is_operator1` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持呼叫服务员',
  `is_operator2` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持打包',
  `kefu_qrcode` varchar(500) NOT NULL DEFAULT '',
  `reservation_announce` varchar(1000) NOT NULL DEFAULT '' COMMENT '预定公告',
  `is_business` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否支持子商户支付',
  `business_id` int(10) NOT NULL DEFAULT '0' COMMENT '子商户活动ID',
  `wechat` tinyint(1) NOT NULL DEFAULT '1',
  `alipay` tinyint(1) NOT NULL DEFAULT '1',
  `credit` tinyint(1) NOT NULL DEFAULT '1',
  `delivery` tinyint(1) NOT NULL DEFAULT '1',
  `delivery_isnot_today` tinyint(1) NOT NULL DEFAULT '0',
  `is_speaker` tinyint(1) NOT NULL DEFAULT '1',
  `screen_mode` tinyint(1) NOT NULL DEFAULT '1',
  `screen_title` varchar(200) NOT NULL DEFAULT '',
  `screen_bg` varchar(500) NOT NULL DEFAULT '',
  `screen_bottom` varchar(200) NOT NULL DEFAULT '',
  `begintime1` varchar(20) DEFAULT '09:00' COMMENT '开始时间',
  `endtime1` varchar(20) DEFAULT '18:00' COMMENT '结束时间',
  `begintime2` varchar(20) DEFAULT '09:00' COMMENT '开始时间',
  `endtime2` varchar(20) DEFAULT '18:00' COMMENT '结束时间',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_tables` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `tablezonesid` int(10) unsigned NOT NULL DEFAULT '0',
  `title` varchar(200) NOT NULL DEFAULT '' COMMENT '名字(桌台号)',
  `user_count` int(10) NOT NULL DEFAULT '0' COMMENT '可供就餐人数',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
  `url` varchar(500) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_tables_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `tablesid` int(10) unsigned NOT NULL DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `from_user` varchar(200) NOT NULL DEFAULT '',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=84 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_tablezones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0',
  `title` varchar(200) NOT NULL DEFAULT '',
  `limit_price` int(10) unsigned NOT NULL DEFAULT '0',
  `reservation_price` int(10) unsigned NOT NULL DEFAULT '0',
  `table_count` int(10) NOT NULL DEFAULT '0' COMMENT '餐桌数量',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_template` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `weid` int(10) NOT NULL DEFAULT '0',
  `template_name` varchar(50) NOT NULL DEFAULT 'style1',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_tpl_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned DEFAULT '0',
  `storeid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '门店编号',
  `orderid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单编号',
  `ordersn` varchar(100) DEFAULT '',
  `from_user` varchar(100) DEFAULT '' COMMENT '接收者openid',
  `content` varchar(1000) DEFAULT '' COMMENT '内容',
  `result` varchar(200) DEFAULT '' COMMENT '内容结果',
  `dateline` int(10) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `ims_weisrc_dish_type` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `weid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属帐号',
  `name` varchar(50) NOT NULL COMMENT '类型名称',
  `parentid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级分类ID,0为第一级',
  `displayorder` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
EOF;
pdo_run($sql);
